package com.cw.java8.builtInFunction;

import java.util.function.Supplier;

/**
 * 生产者演示
 *
 */
public class MySupplier {

    public static void main(String[] args) {

        // T get(); 生产者就是生产东西
        Supplier<String> supplier = () -> "Hello world";
        String str = supplier.get();
        System.out.println(str);


        Supplier<String> supplier2 = () -> {
            return "Hello world";
        };
        String str2 = supplier2.get();
        System.out.println(str2);
    }
}
